import store from './store'

const microApps = [
  {
    name: 'sub-vue',
    entry: process.env.VUE_APP_SUB_VUE,
		activeRule: '/sub-vue',
		isSubMenu: false
  },
  {
    name: 'sub-react',
    entry: process.env.VUE_APP_SUB_REACT,
		activeRule: '/sub-react',
		isSubMenu: false
	},
	{
    name: '文章列表',
    entry: process.env.VUE_APP_SUB_VUE_NEWSDETAIL,
		activeRule: '/sub-vue-newsdetail',
		isSubMenu: true
  }
];

const apps = microApps.map(item => {
  return {
    ...item,
    container: '#subapp-viewport', // 子应用挂载的div
    props: {
      routerBase: item.activeRule, // 下发基础路由
      getGlobalState: store.getGlobalState // 下发getGlobalState方法
    }
  }
})

export default apps
